<template>
  <div>
      <van-field v-model="name" label='名称' placeholder='请输入
      用户名' id='name'/>
      <van-button @click="add" id='add'>添加</van-button>
  </div>
</template>

<script>
export default {
    data(){
        return{
            id:this.$route.query.id,
            name:''

        }
    },
         mrthods: {
             getCate(){
                 this.axios.get('getCateByid?id='+this.id).then(res=>{
                      this.name=res.data.cate.name     
                 })
             },

            add(){
                this.axios.post('cateM',{'name':this.name,'id':this.id}).then(res=>{
                   
                })
            }
        }
}
</script>

<style>

</style>